<template>
  <div>
    <el-dialog
      title="设备详情"
      :visible="dialogVisible"
      width="30%"
      @close="handleClose"
    >
      <div class="xiaoshou">
        <span>销售量:{{ title.salesSome }}</span>
        <span>销售额:{{ salesMoney }}元</span>
        <span>补货次数:{{ title.replenish }}</span>
        <span>维修次数:{{ title.maintain }}</span>
      </div>
      <p>商品销量(月)</p>
      <div class="xiaoliang-month">
        <div v-if="isShow">
          <div v-for="(item,index) in mytea" :key="index">
            <span>{{ item.skuName }}</span>
            <span>{{ item.count }}</span>
          </div>
        </div>
        <div v-else>暂无数据</div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'Detail',
  components: {},
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    title: {
      type: Object,
      required: true
    },
    mytea: {
      type: Array,
      required: true
    }
  },
  data() {
    return {

    }
  },
  computed: {
    salesMoney() {
      return (this.title.salesMoney) / 100
    },
    isShow() {
      return this.mytea.length === 0 ?false:true
    }
  },
  watch: {},
  created() {
  },
  methods: {
    handleClose() {
      this.$emit('update:dialogVisible', false)
    }
  }
}
</script>

<style scoped>

</style>
